﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Himp.Platform.Migrations
{
    /// <inheritdoc />
    public partial class add_colummn_model_StdPhrDictId : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_MainDataModelPropertyDict_MainStdPhrDict_StdPhrDictID",
                table: "MainDataModelPropertyDict");

            migrationBuilder.RenameColumn(
                name: "StdPhrDictID",
                table: "MainDataModelPropertyDict",
                newName: "StdPhrDictId");

            migrationBuilder.RenameIndex(
                name: "IX_MainDataModelPropertyDict_StdPhrDictID",
                table: "MainDataModelPropertyDict",
                newName: "IX_MainDataModelPropertyDict_StdPhrDictId");

            migrationBuilder.AddForeignKey(
                name: "FK_MainDataModelPropertyDict_MainStdPhrDict_StdPhrDictId",
                table: "MainDataModelPropertyDict",
                column: "StdPhrDictId",
                principalTable: "MainStdPhrDict",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_MainDataModelPropertyDict_MainStdPhrDict_StdPhrDictId",
                table: "MainDataModelPropertyDict");

            migrationBuilder.RenameColumn(
                name: "StdPhrDictId",
                table: "MainDataModelPropertyDict",
                newName: "StdPhrDictID");

            migrationBuilder.RenameIndex(
                name: "IX_MainDataModelPropertyDict_StdPhrDictId",
                table: "MainDataModelPropertyDict",
                newName: "IX_MainDataModelPropertyDict_StdPhrDictID");

            migrationBuilder.AddForeignKey(
                name: "FK_MainDataModelPropertyDict_MainStdPhrDict_StdPhrDictID",
                table: "MainDataModelPropertyDict",
                column: "StdPhrDictID",
                principalTable: "MainStdPhrDict",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }
    }
}
